<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript Const</title>
</head>
<body>
<h2>常量对象可以更改:</h2>

<p id="demo"></p>

<script>
  // 创建对象：
  const car = {type:"Porsche", model:"911", color:"white"};

  // 更改属性：
  car.color = "red";

  // 添加属性：
  car.owner = "Steve";

  // 显示属性：
  document.getElementById("demo").innerHTML = "车主是：" + car.owner;
</script>


</body>
</html>

<!--
但是无法重新为常量对象赋值：
const car = {type:"porsche", model:"911", color:"Black"};
car = {type:"Volvo", model:"XC60", color:"White"};    // ERROR
-->